package cn.wolfcode.dubbo.product.productdata;

import cn.wolfcode.dubbo.User.domain.User;
import cn.wolfcode.dubbo.product.domian.Product;

import java.util.HashMap;
import java.util.Map;

//模拟商品的数据库
public abstract class ProductData {
    private static Map<Long, Product> datas = new HashMap<>();

    static {
        datas.put(1L, new Product(1L, "IPhone XR", new User()));
        datas.put(2L, new Product(2L, "华为P30", new User()));
        datas.put(3L, new Product(3L, "小米9", new User()));
    }

    public static Product get(Long id) {
        return datas.get(id);
    }
}
